package com.lemo.smart.proxy;

import com.lemo.smart.annotation.Aspect;
import com.lemo.smart.annotation.Service;

import java.lang.reflect.Method;
import java.util.Arrays;

import lombok.extern.slf4j.Slf4j;

/**
 * Created by 罗选通 on 2017/12/27.
 */
@Aspect(Service.class)
@Slf4j
public class ServiceAspect extends AspectProxy {

  @Override
  public void after(Class<?> targetClass, Method targetMethod, Object[] methodParams) {
    log.warn("Service=>after=>{}", this.getClass());
    log.info(targetClass + "=>" + targetMethod.getName() + "=>" + Arrays.toString(methodParams));
  }

  @Override
  public void before(Class<?> targetClass, Method targetMethod, Object[] methodParams) {
    log.warn("Service=>before=>{}", this.getClass());
    log.info(targetClass + "=>" + targetMethod.getName() + "=>" + Arrays.toString(methodParams));
  }
}
